import { $http } from './index';
import blobReq from './blobReq';

export function exportRouteList(params = {}) {
    return blobReq.get('/saas/route/export', { params });
}
export function getRouteList(params = {}) {
    return $http.get('/saas/route', { params });
}
export function saveRoute(data = {}) {
    return $http.post('/saas/route', data);
}
export function updateRoute(data = {}) {
    return $http.put('/saas/route', data);
}
export function deleteRoute(data = {}) {
    return $http.delete('/saas/route', { data });
}
export function findPremisesByRouteId(id: number, params = {}) {
    return $http.get('/saas/route/premises/' + id, { params });
}
export function findNotAssociatePremises(params = {}) {
    return $http.get('/saas/route/premises/notAssociate', { params });
}
export function addPremisesToRoute(data = {}) {
    return $http.post('/saas/route/premises', data);
}
export function removePremisesFromRoute(premisesIds: any, data = {}) {
    return $http.delete(`/saas/route/premises/${premisesIds}?company=${data.company}`);
}
export function changeRouteOfPremises(data = {}) {
    return $http.put('/saas/route/premises', data);
}
export function getNotAllotAccountList(data = {}) {
    return $http.post('/saas/route/account/allot/not', data);
}
export function getAllotAccountList(data = {}) {
    return $http.get('/saas/route/account/allot/' + data.id);
}
export function allotAccount(data = {}) {
    return $http.post('/saas/route/account/allot', data);
}
